
#ifndef CHATDIALOG_H
#define CHATDIALOG_H

#include <QtGui/QDialog>
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QListWidget>
#include <QtGui/QTextEdit>
#include <QSplitter>
#include "client.h"

class ChatDialog : public QDialog
{
    Q_OBJECT

    QVBoxLayout * vboxLayout;
    QHBoxLayout * hboxLayout1;
    QSplitter   * splV;

    QTextEdit   * messageWindow;
    QListWidget * contactList;
    QLabel      * label;
    QLineEdit   * messLineEdit;

    QRect workerDims;
    QString workerName;
public:
    ChatDialog( QWidget *parent = 0 );
    void sendWorkerInfo( QString n, QRect r );

public slots:
    void appendMessage( const QString & from, const QString & message );

private slots:
    void returnPressed();
    void newParticipant( const QString & nick );
    void participantLeft( const QString & nick );
    void showInformation();

private:
    Client           client;
    QString          myNickName;
    QTextTableFormat tableFormat;

signals:
    void signalFromWorker( QString name, QRect dims );
};

#endif
